//
//  PositionTool.m
//  MyStock
//
//  Created by 刘翔 on 2025/1/5.
//

#import "PositionTool.h"

@implementation PositionTool
+ (void)addPositionWithCode:(NSString *)code{
    BADataEntity *entity = [BADataEntity new];
    entity.urlString = [NSString stringWithFormat:@"%@/add/%@",POSITIONSTOCKUrl,code];
    entity.needCache = NO;
    entity.parameters = nil;
    [BANetManager ba_request_GETWithEntity:entity successBlock:^(id response) {
        NSDictionary *result = response;
        [MBProgressHUD showMessag:result[@"message"] toView:lxWindow];
        
    } failureBlock:^(NSError *error) {
        [MBProgressHUD showError:@"网络错误" toView:lxWindow];

    } progressBlock:^(int64_t bytesProgress, int64_t totalBytesProgress) {
        
    }];
}

+ (void)removePositionWithCode:(NSString *)code{
    BADataEntity *entity = [BADataEntity new];
    entity.urlString = [NSString stringWithFormat:@"%@/remove/%@",POSITIONSTOCKUrl,code];
    entity.needCache = NO;
    entity.parameters = nil;
    [BANetManager ba_request_GETWithEntity:entity successBlock:^(id response) {
        NSDictionary *result = response;
        [MBProgressHUD showMessag:result[@"message"] toView:lxWindow];
        
    } failureBlock:^(NSError *error) {
        [MBProgressHUD showError:@"网络错误" toView:lxWindow];

    } progressBlock:^(int64_t bytesProgress, int64_t totalBytesProgress) {
        
    }];
    
}
@end
